/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cqcis.uip.base.framework.core;

import com.cqcis.uip.base.framework.common.impl.AttributesImpl;

/**
 * 服务事件
 * 
 * @author huangmy
 * @date   2008-9-3
 */
public class RegisteredServiceEvent extends AttributesImpl<Object> {
	private static final long serialVersionUID = 1L;
	private RegisteredServiceEventType type; // 状态
	private RegisteredService service; // 服务
	
	public RegisteredServiceEvent(RegisteredServiceEventType type, RegisteredService service) {
		this.type = type;
		this.service = service;
	}
	
	@Override
	public String toString() {
		StringBuffer b = new StringBuffer();
		b.append("event:{type: ").append(this.type)
		 .append("; service: " + this.service)
		 .append("; attributes: " + super.getAttributes())
		 .append("}");
		return b.toString();
	}
		
	/**
	 * 关联的服务
	 * 
	 * @return
	 */
	public RegisteredService getRegisteredService() {
		return this.service;
	}
	
	/**
	 * 状态
	 * 
	 * @return
	 */
	public RegisteredServiceEventType getType() {
		return this.type;
	}
}
